﻿package org.openChart.sprite.groups 
{
	import org.openChart.display.chart.DisplayBarElement;
	import org.openChart.display.DisplayBaseObject;
	import org.openChart.display.DisplayGroup;
	import org.openChart.sprite.CommandHandler;
	
	/**
	 * ...
	 * @author Chongyuan
	 */
	public class LineGroupSprite extends GroupSprite
	{
		
		public function LineGroupSprite( displayObject:DisplayGroup, commandHandler:CommandHandler)
		{
			super(displayObject, commandHandler);
		}
		
		public override function paint():void
		{
			var displayGroup:DisplayGroup = displayObject as DisplayGroup;
			for (var i:uint = 0; i < displayGroup.length; i++)
			{
				var displayObject_1:DisplayBarElement = displayGroup.getAt(i) as DisplayBarElement;
				var displayObject_2:DisplayBarElement = displayGroup.getAt(i + 1) as DisplayBarElement;
				drawLine(displayObject_1.position.x + displayObject_1.width / 2, displayObject_1.position.y - displayObject_1.height, displayObject_2.position.x + displayObject_2.width / 2, displayObject_2.position.y - displayObject_2.height, 2); 
			}
		}
		
	}
	
}